package com.qzsoft.zhjd.server.modules.ludong.asphalt.service.impl;

import com.qzsoft.zhjd.server.modules.ludong.asphalt.entity.AsphaltConcreteCollectionEntity;
import com.qzsoft.zhjd.server.modules.ludong.asphalt.mapper.AsphaltConcreteCollectionMapper;
import com.qzsoft.zhjd.server.modules.ludong.asphalt.service.AsphaltConcreteCollectionService;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 功能描述:沥青混凝土数据采集接口实现类
 *
 * @author : liugf
 * @date : 2020/6/9 8:44
 */
@Service
public class AsphaltConcreteCollectionServiceImpl
        extends ServiceImpl<AsphaltConcreteCollectionMapper, AsphaltConcreteCollectionEntity>
        implements AsphaltConcreteCollectionService {


    /**
     * 功能描述: 先删除后添加
     *
     * @param entity 实体类
     * @return : void
     * @author : liugf
     * @date : 2020/6/10 20:25
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void insertAndRemoveData(AsphaltConcreteCollectionEntity entity) {
        removeById(entity.getId());
        save(entity);
    }

}
